package com.game;

import com.badlogic.gdx.math.Rectangle;
import com.badlogic.gdx.math.Vector2;;

public class Char  {

	public enum State {
		IDLE, WALKING, JUMPING, DYING
	}
	
	static final float SPEED = 4f;
	static final float JUMP_VELOCITY = 1f;
	static final float SIZE = 0.5f;
	
	Vector2 position = new Vector2();
	Vector2 acceleration = new Vector2();
	Vector2 velocity = new Vector2();
	Rectangle bounds = new Rectangle();
	State state = State.IDLE;
	boolean facingLeft = true;
	
	public Char(Vector2 position){
		this.position = position;
		this.bounds.height = SIZE;
		this.bounds.width = SIZE;
	}
	
	public Vector2 getPosition(){
		return position;
	}
	
	public Rectangle getBounds(){
		return bounds;
	}
	
	public Vector2 getAcceleration(){
		return acceleration;
	}
	
	public Vector2 getVelocity(){
		return velocity;
	}
	
	public void setFacingLeft(boolean b){
		this.facingLeft = b;
	}
	
	public void setState(State newState){
		this.state = newState;
	}
	
	public void update(float d){
		position.add(velocity.tmp().mul(d));
	}
	
}
